using AI.Graph;
using UnityEngine;

[CreateNodeMenu("Sub State/Enable GameObject")]
public class EnableGameObjectSubState : SubState {


    [ParameterType (typeof (GameObject), "Object to enable")]
    public ExposedParameter gameObjectParameter;

    public bool enableGameObject = true;


    protected override void OnPerform (AIBehaviour aiBehaviour) {
        if (aiBehaviour.TryGetExposedObject (gameObjectParameter, out GameObject gameObject)) {
            gameObject.SetActive (enableGameObject);
        }
    }


}